package modules

import (
	"cld-quick-cli/controllers"
	"cld-quick-cli/router/middlewares"
	"github.com/gin-gonic/gin"
)

func PostRouter(router *gin.Engine) {
	postRouter := router.Group("/post")
	postRouter.Use(middlewares.JWTAuthMiddleware())
	postRouter.POST("/send", controllers.SendNewPost())
	postRouter.PUT("/update", controllers.UpdatePost())
	postRouter.GET("/:id", controllers.GetPostDetails())
	postRouter.GET("/list", controllers.GetPostListByFilterParams())
	postRouter.POST("/vote", controllers.VotePost())
	postRouter.POST("/rankByTime", controllers.GetPostRankByTime())
}
